home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / Technical Documentation / develop / develop Issue 24 / develop Issue 24 code / Scriptable Database 1.0a15 / Foundation / ScriptableObjectList.h < prev   
Encoding:
C/C++ Source or Header  |  1996-02-19  |  1.8 KB  |  64 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        ScriptableObjectList.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    Andy Nicholas, Greg Anderson, Chris Bingham, John Rohrlich, Max McFarland, Paul Ossenbruggen, Mike Kobb
  7.  
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.          <1>      6/6/95    ga        
  11.  
  12. */
  13.  
  14.  
  15. #ifndef __SCRIPTABLEOBJECTLIST__
  16. #define __SCRIPTABLEOBJECTLIST__
  17.  
  18. //
  19. // We wouldn't need the entire list file if we didn't include an iterator
  20. // in our class
  21. //
  22. #include "ListTemplate.h"
  23.  
  24. //
  25. // AbstractIterator is needed for definition of TAbstractIterator
  26. //
  27. #include "AbstractIterator.h"
  28.  
  29. class TAbstractScriptableObject;
  30.  
  31.  
  32. //========================================================================================
  33. // Class TScriptableObjectListIterator
  34. //========================================================================================
  35. class TScriptableObjectListIterator : public TAbstractObjectIterator
  36. {
  37. public:    
  38.     virtual ~TScriptableObjectListIterator();
  39.  
  40.     TScriptableObjectListIterator(AListOf<TAbstractScriptableObject*>* list) :
  41.         fList(list), fIter(list) {}
  42.     
  43.     //
  44.     // Interface to code to:
  45.     //
  46.     virtual void                            Reset(const TAETransaction& t, Boolean iterationDirection = kForwardIteration);
  47.     virtual Boolean                            More(const TAETransaction&) const;
  48.     virtual void                            Next(const TAETransaction&);
  49.     virtual TAbstractScriptableObject*        Current(const TAETransaction&);
  50.  
  51.     //
  52.     // Override these methods to improve performance:
  53.     //
  54.     virtual long                            CountElements(const TAETransaction& t, DescType desiredClass);
  55.     virtual TAbstractScriptableObject*        GetIndexedElement(const TAETransaction& t, DescType desiredClass, long index);
  56.     virtual Boolean                            Contains(const TAETransaction& t, TAbstractScriptableObject* objectToTestForMembership);
  57.  
  58. private:
  59.     AListOf<TAbstractScriptableObject*>*                fList;
  60.     AnIteratorOfAListOf<TAbstractScriptableObject*>        fIter;
  61. };
  62.  
  63. #endif
  64.